package com.example.hystrixdemo.service;

import com.example.hystrixdemo.fallback.GitHubFeignServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Package: com.example.hystrixdemo.service
 * @ClassName: GitHubFeignService
 * @Author: Think
 * @CreateTime: 2021/7/8 14:20
 * @Description:
 */
@FeignClient(name = "github", url = "https://api.github.com", fallback = GitHubFeignServiceFallBack.class)
public interface GitHubFeignService {

    /**
     * 等同于调用https://api.github.com/search/repositories?q=xxx
     * @param queryString
     * @return
     */
    @RequestMapping(value = "/search/repositoriessss", method = RequestMethod.GET)
    String searchRepo(@RequestParam("q") String queryString);

}
